const recipeSchema = new mongoose.Schema({
  name: { type: String, required: true, text: true }, // 添加全文索引
  ingredients: [{
    name: { type: String, required: true },
    amount: String,
    substitutes: [String] // 替代食材
  }],
  steps: [{
    description: String,
    duration: Number, // 步骤耗时(分钟)
    tips: String
  }],
  nutrition: {
    calories: { type: Number, min: 0 },
    protein: { type: Number, min: 0 },
    carbs: { type: Number, min: 0 }
  },
  dietaryTags: [String], // 饮食标签
  difficulty: { type: String, enum: ['easy', 'medium', 'hard'] }
});